<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>UtilsColor.js - QUnit.js tests</title>
		<link href="../../common/qunit/qunit-1.11.0.css" rel="stylesheet">
		<script src="../../common/qunit/qunit-1.11.0.js"></script>
		<script src="../../Dependencies/src/?need=Class"></script>
		<script src="../src/UtilsColor.js"></script>

		<script>
			test("HSLColor.RGBtoHSL(0, 255, 0)", function()
			{
				var color = HSLColor.RGBtoHSL(0, 255, 0);
				equal(color.h, 120/360, "color.h==1/3");
				equal(color.s, 1, "color.s==1");
				equal(color.l,.5, "color.l==0.5");
			});
			test("HSLColor.HSLtoRGB(1/3, 1, 0.5)", function()
			{
				var color = HSLColor.HSLtoRGB(1/3, 1, 0.5);
				equal(color.r, 0, "color.r==0");
				equal(color.g, 255, "color.g==255");
				equal(color.b,.0, "color.b==0");
			});
			test("var color = new HSLColor()", function()
			{
				var color = new HSLColor();
				equal(color.getRGB(), "rgb(0, 0, 0)", "color.getRGB()==rgb(0, 0, 0)");
				equal(color.getRGBA(), "rgba(0, 0, 0, 1)", "color.getRGBA()==rgba(0, 0, 0, 1)");
				equal(color.getH(), 0, "color.getH()==0");
				equal(color.getS(), 0, "color.getS()==0");
				equal(color.getL(), 0, "color.getL()==0");

				equal(color.setH(250), null, "color.setH(250)");
				equal(color.setS(1), null, "color.setS(1)");
				equal(color.setL(.5), null, "color.setL(.5)");

				equal(color.getRGB(), "rgb(42, 0, 255)", "color.getRGB()==rgb(42, 0, 255)");
				equal(color.setAlpha(.5), null, "color.setAlpha(.5)");
				equal(color.getRGBA(), "rgba(42, 0, 255, 0.5)", "color.getRGBA()==rgba(42, 0, 255, 0.5)");
			});
		</script>
	</head>
	<body>
		<div id="qunit"></div>
        <div id="qunit-fixture"></div>
	</body>
</html>